import { pget, ppostJson } from '@/utils/req';
import { modalApi } from '@/utils/modalReq';

// 获取部门列表
export function getDeptList(query: any) {
  return pget(`${modalApi.system}/department/list`, query);
}

// 新增部门
export function addDept(val: any) {
  return ppostJson(`${modalApi.system}/department/create`, val);
}

// 修改部门
export function editDept(departmentId: string, val: any) {
  return ppostJson(`${modalApi.system}/department/update/${departmentId}`, val);
}

// 删除部门
export function deleteDept(departmentId: string) {
  return ppostJson(`${modalApi.system}/department/delete/${departmentId}`);
}

// 查看部门
export function viewDept(departmentId: string) {
  return pget(`${modalApi.system}/department/info/${departmentId}`);
}

// 模板维护列表
export function templateconfigList(query: any) {
  return pget(`${modalApi.common}/shopec-template-config/templateconfig/page`, query);
}

// 模板维护编辑
export function templateconfigUpdate(query: any) {
  return ppostJson(`${modalApi.common}/shopec-template-config/templateconfig/update`, query);
}
// 模板维护新增
export function templateconfigSave(query: any) {
  return ppostJson(`${modalApi.common}/shopec-template-config/templateconfig/save`, query);
}

// 获取类型下拉列表
export function getTemplateType() {
  return pget(`${modalApi.common}/shopec-template-config/templateconfig/getTemplateType`);
}
